//
//  DsCellVC.m
//  Tour
//
//  Created by 张张烨 on 16/3/9.
//  Copyright © 2016年 张中烨. All rights reserved.
//
#define kWidth self.view.frame.size.width
#define kHeight self.view.frame.size.height
#import "DsCellVC.h"
#import "DsCellCell.h"
#import "DsCellModel.h"
#import "DsCellView.h"
#import "DsCellWenziCell.h"
#import "DsCellDateModel.h"
#import "DsCellZiTupianCell.h"
#import "DsCellDateModeler.h"
#import "DsCellDateModelsan.h"
#import "DsCellDateModelsi.h"
#import "DsCellSiCell.h"
#import "LeftView.h" // 隐藏的tableView试图
#import "DsTouxiangVC.h"
#import <TencentOpenAPI/TencentOAuth.h>
@interface DsCellVC () <UITableViewDataSource,UITableViewDelegate,UIScrollViewDelegate,LeftViewDelegate,passTagDelegate,TencentSessionDelegate,TencentLoginDelegate>

/**<  QQ */
@property (nonatomic, strong) TencentOAuth *tencentOAuth;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *viewDataArr;
@property (nonatomic, strong) NSMutableArray *timeDataArr;/**<  时间数组 */
@property (nonatomic, strong) NSMutableArray *dataArr;/**<  cell 数组 */
@property (nonatomic, strong) NSMutableDictionary *dataDic;
@property (nonatomic, strong) NSMutableArray *data;
@property (nonatomic, retain) UIImageView *placeImageView;/**<  姑且放着放着 */
@property (nonatomic, strong) DsCellView *touView;

@property (nonatomic,retain) NSMutableArray *contentArr;
@property (nonatomic,retain)NSMutableArray *sectionArr;
@property (nonatomic,retain)NSMutableArray *nsindexPathArray;//左侧视图传入数组一
@property (nonatomic,retain)NSMutableArray *zeroNames;//左侧视图传入数组二(reloadData在这个数组赋值给view时触发)
@property (nonatomic,assign)NSInteger leftViewCount;//判定左侧视图的数组是否已经填满
@property (nonatomic,retain)LeftView *leftView;//左侧视图
@property (nonatomic,retain)UIButton *leftViewButton;//引出左侧视图的按钮
@property (nonatomic,strong) NSDictionary *dic;

@property(nonatomic,assign)BOOL isShoucang;

@end

@implementation DsCellVC

//懒加载
- (NSMutableArray *)contentArr{
    if (_contentArr == nil) {
        _contentArr = [[NSMutableArray alloc]init];
    }
    return _contentArr;
}

- (NSMutableArray *)sectionArr{
    if (_sectionArr == nil) {
        _sectionArr = [[NSMutableArray alloc]init];
    }
    return _sectionArr;
}

- (NSMutableArray *)nsindexPathArray{
    if (_nsindexPathArray == nil) {
        _nsindexPathArray = [[NSMutableArray alloc]init];
    }
    return _nsindexPathArray;
}
- (NSMutableArray *)zeroNames{
    if (_zeroNames == nil) {
        _zeroNames = [[NSMutableArray alloc]init];
    }
    return _zeroNames;
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
//    self.navigationController.navigationBar.alpha = 1;

//
//    [[Youjiku shareInstance] openDb];
//    [[Youjiku shareInstance] creteTable];
//    
//    NSArray *arr = [[Youjiku shareInstance] selet];
//    
//    Youjikulei * aaa = [[Youjikulei alloc]init];
//    if (arr.count) {
//        aaa.idddd = _dic[@"id"];
//        for (Youjikulei * m in arr) {
//            if ([aaa.idddd isEqualToString:m.idddd]) {
//                UIAlertView *al = [[UIAlertView alloc]initWithTitle:@"收藏成功" message:@"确定" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//                [al show];
//                break;
//            }else{
//                UIAlertView *al1 = [[UIAlertView alloc]initWithTitle:@"已收藏" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//                [al1 show];
//            }
//            
//        }
//        
//    }else{
////        UIAlertView *al = [[UIAlertView alloc]initWithTitle:@"以收藏" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
////        [al show];
//    }
    

    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
//    self.navigationController.navigationBar.translucent = NO;
//    self.navigationController.navigationBar.barTintColor = [UIColor clearColor];
//    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    
   self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"返回"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    
    [self shuju];
    [self tableView1];
    
    [self createLeftView];
    [self addSwipeGesture];/**<  添加返回手势 */
    [self rightItem]; /**<  <#注释#> */
    
    
}
- (void)back
{
    [self.navigationController popViewControllerAnimated:YES];
}

/**<  右侧按钮 */
- (void)rightItem
{
    UIBarButtonItem *rigthItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:(UIBarButtonItemStylePlain) target:self action:@selector(you)];
    UIBarButtonItem *rigthItem1 = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"shoucang"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ] style:(UIBarButtonItemStylePlain) target:self action:@selector(shouchang)];
    self.navigationItem.rightBarButtonItems = @[rigthItem,rigthItem1];
    
}

- (void)shouchang
{
    Youjikulei *daku = [[Youjikulei alloc] init];
    
    daku.tupian =_dic[@"front_cover_photo_url"];
    daku.mingzi =_dic[@"name"];
    daku.idddd = _dic[@"id"];
    
    if (!_isShoucang) {
        

        _isShoucang = 1;
        /**<  收重复从夫 */
        NSMutableArray *arr = [[Youjiku shareInstance] selet];
        for (Youjikulei * r  in arr) {
            if ([r.mingzi isEqualToString:daku.mingzi]) {
                UIAlertView *al = [[UIAlertView alloc]initWithTitle:@"以收藏" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
                [al show];
                return;
                
            }
        }
        [[Youjiku shareInstance] insertWangzhi:daku];
        
        UIAlertView *al = [[UIAlertView alloc]initWithTitle:@"收藏成功" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [al show];
        
    }else{
        
        [[Youjiku shareInstance] deleteNumber:daku.mingzi];
        UIAlertView *al = [[UIAlertView alloc]initWithTitle:@"删除成功" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [al show];
        _isShoucang = 0;
    }
    
    
    
    
    
}


- (void)you
{
    NSLog(@"登陆");
    
//    
//    _tencentOAuth = [[TencentOAuth alloc] initWithAppId:@"1105183015" andDelegate:self];
//    
//    if (_tencentOAuth.accessToken) {
//        [_tencentOAuth setAccessToken:_tencentOAuth.accessToken];
//        [_tencentOAuth setOpenId:_tencentOAuth.openId];
//        [_tencentOAuth setExpirationDate:_tencentOAuth.expirationDate];
//        
//    }else{
//        NSArray* permissions = [NSArray arrayWithObjects:
//                                kOPEN_PERMISSION_GET_USER_INFO,
//                                kOPEN_PERMISSION_GET_SIMPLE_USER_INFO,
//                                kOPEN_PERMISSION_ADD_ALBUM,
//                                kOPEN_PERMISSION_ADD_ONE_BLOG,
//                                kOPEN_PERMISSION_ADD_SHARE,
//                                kOPEN_PERMISSION_ADD_TOPIC,
//                                kOPEN_PERMISSION_CHECK_PAGE_FANS,
//                                kOPEN_PERMISSION_GET_INFO,
//                                kOPEN_PERMISSION_GET_OTHER_INFO,
//                                kOPEN_PERMISSION_LIST_ALBUM,
//                                kOPEN_PERMISSION_UPLOAD_PIC,
//                                kOPEN_PERMISSION_GET_VIP_INFO,
//                                kOPEN_PERMISSION_GET_VIP_RICH_INFO,
//                                nil];
//        
//        [_tencentOAuth authorize:permissions inSafari:NO];
//    }
//    
}
#pragma mark - qq回调协议
- (void)getUserInfoResponse:(APIResponse*) response
{
    // 三方登陆获取的头像数据
    //    "figureurl_qq_1" = "http://q.qlogo.cn/qqapp/1105164233/877B7E00A3B8F2A5CEF1CE00E9883BAB/40";
    //    "figureurl_qq_2" = "http://q.qlogo.cn/qqapp/1105164233/877B7E00A3B8F2A5CEF1CE00E9883BAB/100";
    NSLog(@"%@",response.jsonResponse);//打印用户信息
    NSLog(@"%@",[response.jsonResponse objectForKey:@"nickname"]);//打印用户昵称
    
    NSString *nameString = [response.jsonResponse objectForKey:@"nickname"];
    NSString *imageString = [NSString stringWithFormat:@"%@",[response.jsonResponse objectForKey:@"figureurl_qq_2"]];//用户头像
    // 单例保存
    [[NSUserDefaults standardUserDefaults] setObject:nameString forKey:@"name"];
    [[NSUserDefaults  standardUserDefaults] setObject:imageString forKey:@"image"];
    NSLog(@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"image"]);
    
    
    
}
#pragma mark - 点击取消键盘

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}
-(void)tencentDidLogin
{
    //    _labelTitle.text = @"登录完成";
    if (_tencentOAuth.accessToken && 0 != [_tencentOAuth.accessToken length])
    {
        //  记录登录用户的OpenID、Token以及过期时间
        //        _labelAccessToken.text = _tencentOAuth.accessToken;
        NSLog(@"%@", _tencentOAuth.accessToken);
        [_tencentOAuth accessToken];
        [_tencentOAuth openId];
        [_tencentOAuth expirationDate];
        
        [_tencentOAuth getUserInfo];
        NSLog(@"登陆成功");
    }
    else
    {
        //        _labelAccessToken.text = @"登录不成功 没有获取accesstoken";
        NSLog(@"登陆不成功, 没有获取accesstoken");
    }
}

-(void)tencentDidNotLogin:(BOOL)cancelled
{
    if (cancelled)
    {
        //        _labelTitle.text = @"用户取消登录";
        NSLog(@"用户取消登陆");
    }
    else
    {
        //        _labelTitle.text = @"登录失败";
        NSLog(@"登陆失败");
    }
}
- (void)tencentDidNotNetWork
{
    NSLog(@"网络问题登录失败");
}
- (NSArray *)getAuthorizedPermissions:(NSArray *)permissions
                      withExtraParams:(NSDictionary *)extraParams
{
    NSLog(@"~~~~~~~%@\n %@", permissions, extraParams);
    return permissions;
}
#pragma mark - 控制下拉放大
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    
//    //刚开始y的偏移量初始值就是-264
//    //    NSLog(@"y1 === %f",scrollView.contentOffset.y);
//    CGFloat y = scrollView.contentOffset.y;//加上导航栏高度,第一次是-200
//    //    NSLog(@"y2 === %f",y);
//    //
//    if (y < -0.6 * SCREEN_WIDTH) {
//        CGRect frame = self.touView.frame;
//        frame.origin.y = y;//偏移了多少,
//        frame.size.height =  -y;//tablview向下偏移了多少,高度就是多少
//        self.touView.frame = frame;
//    }
    
    
    
    // 只要视图滚动 就会一直触发该方法
    // 任何偏移量的改变 都会触发该方法
    if (_tableView.contentOffset.y == 0) {
        self.navigationController.navigationBar.alpha = 1;
    }else{
    _tableView.contentInset = scrollView.contentInset;
    
    if (_tableView.contentOffset.y >=1 ) {
        self.navigationController.navigationBar.alpha = 1;
    }else if (_tableView.contentOffset.y >=10 ){
        self.navigationController.navigationBar.alpha = 0.1;
    }else if (_tableView.contentOffset.y >=100 ){
        self.navigationController.navigationBar.alpha = 0.1;
    }else{
        self.navigationController.navigationBar.alpha = 0.5;
    }
    if (_tableView.contentOffset.y <=1 ) {
        self.navigationController.navigationBar.alpha = 1;
    }else if (_tableView.contentOffset.y <=10 ){
        self.navigationController.navigationBar.alpha = 0.1;
    }else if (_tableView.contentOffset.y <=100 ){
        self.navigationController.navigationBar.alpha = 0.1;
    }else{
        self.navigationController.navigationBar.alpha = 0.5;
    }
    }
}



- (void) shuju
{

    [AFNModel GETWithHandler:[NSString stringWithFormat:@"http://chanyouji.com/api/trips/%@.json",self.userid] completion:^(id result) {
        NSLog(@"%@",self.userid);
        self.dic = result;
        self.touView = [[DsCellView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 250 * GAO) touxiang:self.touxiang kaishitian:result[@"start_date"] jieshutian:result[@"end_date"] mingzi:result[@"name"]beijing:result[@"front_cover_photo_url"]];
        _touView.delegate =self;
        self.tableView.tableHeaderView = _touView;
        
        NSMutableArray *arr = result[@"trip_days"];
        self.timeDataArr = [NSMutableArray array];
        DsCellModel *model = [[DsCellModel alloc]init];
        for (NSDictionary *dic in arr) {
            [model setValuesForKeysWithDictionary:dic];
            [_timeDataArr addObject:model];
        }
        self.timeDataArr = [DsCellModel modelHanderWithArray:arr];
        
        
        
        
        
        self.dataArr = [NSMutableArray array];
        // 对的
        NSMutableArray *arr1 = result[@"trip_days"];
        
        for (NSDictionary *days in arr1) {
            DsCellDateModel *detailContent = [[DsCellDateModel alloc]initWithDictionary:days];
            [self.contentArr addObject:detailContent];
        }
        for (DsCellDateModel *one in self.contentArr) {
            NSMutableArray *sectionTemp = [NSMutableArray array];
            for (DsCellDateModeler *two in one.nodess) {
                for (DsCellDateModelsan *three in two.notess) {
                    if ([three.col isEqualToNumber:@(0)]) {
                        self.leftViewCount++;
                    }
                    [sectionTemp addObject:three];
                }
            }
            [self.sectionArr addObject:sectionTemp];
        }
        [_tableView reloadData];
        //拿到数据后给左侧视图赋值
        if (_nsindexPathArray.count) {
            for (int i = 0; i < _nsindexPathArray.count - 1; i++) {
                for (int j = 0; j < _nsindexPathArray.count - 1 - i; j++) {
                    if ([_nsindexPathArray[j] section] > [_nsindexPathArray[j + 1] section]){
                        NSIndexPath *temp = self.nsindexPathArray[j];
                        self.nsindexPathArray[j] = self.nsindexPathArray[j + 1];
                        self.nsindexPathArray[j + 1] = temp;
                        NSString *tempStr = _zeroNames[j];
                        _zeroNames[j] = _zeroNames[j + 1];
                        _zeroNames[j + 1] = tempStr;
                    }
                }
            }
        }
        [self.leftView setNsIndexPathArray:_nsindexPathArray];
        [self.leftView setTitileArray:_zeroNames];
        
        [self.placeImageView removeFromSuperview];
        
    }];
}
#warning mark -- 上线需要注掉这个方法

-(void)passTag
{
//    DsTouxiangVC *VC = [[DsTouxiangVC alloc]init];
//    VC.userid = [_dic[@"user"][@"id"] stringValue];
//    [self.navigationController pushViewController:VC animated:YES];
}

- (void)tableView1
{
    self.tableView = [[UITableView alloc] initWithFrame:self.view.frame style:(UITableViewStylePlain)];
    
    self.tableView.dataSource = self;
    
    self.tableView.delegate = self;
//    [_tableView NightWithType:UIViewColorTypeNormal];
    [self.view addSubview:_tableView];
    
    [self.tableView registerClass:[DsCellCell class] forCellReuseIdentifier:@"tupian"];
    [self.tableView registerClass:[DsCellWenziCell class] forCellReuseIdentifier:@"wenzi"];
    [self.tableView registerClass:[DsCellZiTupianCell class] forCellReuseIdentifier:@"tuzi"];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.sectionArr.count ? self.sectionArr.count : 0 ;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    NSArray *arr = self.sectionArr[section];
    return self.sectionArr.count ? arr.count : 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
     NSArray *tempArr = [self.sectionArr objectAtIndex:indexPath.section];
    DsCellDateModelsan *temp = [tempArr objectAtIndex:indexPath.row];
    if ([temp.col isEqualToNumber:@(0)]) {
        if (temp.photos) {
            DsCellCell *cell = [DsCellCell travel_Detail_CellTwoWithTableView:tableView];
            cell.cellContent = temp;
            
            return cell;
        }else{
            DsCellWenziCell *cell = [DsCellWenziCell travel_Detail_CellOneWithTableView:tableView];
            cell.cellContent = temp;
            return cell;
        }
    } else {
        if (temp.photos) {
            /**<   */
            DsCellZiTupianCell *cell = [DsCellZiTupianCell travel_Detail_CellFourWithTableView:tableView];
            cell.cellContent = temp;
            return cell;
        }else{
            /**<  一个lable */
            DsCellSiCell *cell = [DsCellSiCell travel_Detail_CellThreeWithTableView:tableView];
            cell.cellContent = temp;
            return cell;
        }
    }


}
/**<  分区高度 */
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 30 * GAO;
}



// 分区头名称
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    DsCellModel *model = _timeDataArr[section];
    
    NSDate *aDate = [NSDate dateWithTimeIntervalSinceReferenceDate:[model.updated_at doubleValue]];

    
    NSString *str =[NSString stringWithFormat:@"Day %@   日期:%@   %@",[model.day stringValue],model.trip_date,[self weekdayStringFromDate:aDate]];
    return str;
}
/**<  时间戳转换为星期几 */
- (NSString*)weekdayStringFromDate:(NSDate*)inputDate {
    
    NSArray *weekdays = [NSArray arrayWithObjects: [NSNull null], @"周天", @"周一", @"周二", @"周三", @"周四", @"周五", @"周六", nil];
    
    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    
    NSTimeZone *timeZone = [[NSTimeZone alloc] initWithName:@"Asia/Shanghai"];
    
    [calendar setTimeZone: timeZone];
    
    NSCalendarUnit calendarUnit = NSCalendarUnitWeekday;
    
    NSDateComponents *theComponents = [calendar components:calendarUnit fromDate:inputDate];
    
    return [weekdays objectAtIndex:theComponents.weekday];
    
}



/**<  高度*/
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray *tempArr = [self.sectionArr objectAtIndex:indexPath.section];
    DsCellDateModelsan *temp = [tempArr objectAtIndex:indexPath.row];
    CGFloat textHeight = [LCAFNetWorking AutoSizeOfHeightWithText:temp.descriptionF andFont:[UIFont systemFontOfSize:15] andLabelWidth:self.view.frame.size.width - (20 * KUAN)];
    if ([temp.col isEqualToNumber:@(0)]) {
        //再返回行高方法中给数组添加对象,填满后赋值给左侧视图
        if (_leftViewCount > self.zeroNames.count) {
            [self.zeroNames addObject:temp.zeroText];
            [self.nsindexPathArray addObject:indexPath];
        }
        CGFloat siteViewHeight = 60 * GAO;
        if (temp.photos) {
            CGFloat photoViewHeight = (self.view.frame.size.width - (20 *KUAN )) * [temp.photos.image_height floatValue] / [temp.photos.image_width floatValue];
            return siteViewHeight + photoViewHeight + textHeight + (30 * GAO);
        }else{
            return siteViewHeight + textHeight + (30 * GAO);
        }
    } else {
        if (temp.photos) {
            CGFloat photoViewHeight = (self.view.frame.size.width - (20 * KUAN)) * [temp.photos.image_height floatValue] / [temp.photos.image_width floatValue];
            return photoViewHeight + textHeight + (30 * GAO);
        }else{
            return textHeight + (30 * GAO);
        }
    }
}
//创建左侧视图
- (void)createLeftView{
    self.leftViewButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.leftViewButton setImage:[UIImage imageNamed:@"leftViewBtn"] forState:UIControlStateNormal];
//    [self.leftViewButton setHidden:YES];
    [self.leftViewButton addTarget:self action:@selector(leftViewShow) forControlEvents:UIControlEventTouchUpInside];
    [self.leftViewButton setFrame:CGRectMake(20 * KUAN, kHeight - (110 * GAO), 44*KUAN, 44* KUAN)];
    [self.view addSubview:self.leftViewButton];
    
    self.leftView = [[LeftView alloc]initWithFrame:CGRectMake(- kWidth * 2, 63 * GAO, kWidth, kHeight - (62 * GAO))];
    
    [self.leftView.bigButton addTarget:self action:@selector(leftViewHidden) forControlEvents:UIControlEventTouchUpInside];
    [self.leftView setDelegate:self];
    [self.view addSubview:self.leftView];
   
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];// 取消选中
}

//代理方法
- (void)scrollTo:(NSIndexPath *)indexPath{
    [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
- (void)leftViewHidden{
    [UIView animateWithDuration:0.5 animations:^{
        [self.leftView setFrame:CGRectMake(- kWidth * 2, 63* GAO, kWidth, kHeight - (62 * GAO))];
    }];
}
- (void)leftViewShow{
    [UIView animateWithDuration:0.5 animations:^{
        [self.leftView setFrame:CGRectMake(0, 63 * GAO, kWidth, kHeight - (62 * GAO ))];
    }];
}
//添加手势
- (void)addSwipeGesture{
    UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(leftSwipe)];
    [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
    [self.leftView addGestureRecognizer:swipeLeft];
    UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(rightSwipe)];
    [swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];
    [self.tableView addGestureRecognizer:swipeRight];
}
- (void)leftSwipe{
    if (self.leftView.frame.origin.x == 0) {
        [self leftViewHidden];
    }
}
- (void)rightSwipe{
    if (self.leftView.frame.origin.x != 0) {
        [self leftViewShow];
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
